<template>
  <div id="index" ref="appRef">
    <div class="bg">
    </div>
  </div>
</template>
<script lang="ts">
import {defineComponent} from 'vue'
import Setting from "@/public/config"
import storage from '@/store'
import router from '@/router'
import Oidc from 'oidc-client'

export default defineComponent({
  components: {
  },
  setup() {
    const config = {
        authority: Setting.Authority,
        client_id: "backend-admin",
        client_secret: "1q2w3e*",
        redirect_uri: Setting.SelfHost + Setting.Ports.BigScreen + "/user/login-callback",
        response_type: "code",
        scope: 'notification-management openid profile role offline_access account common-data big-data asset workflows visual-command internet-of-things internal-gateway hikvision identity narcissus',
        post_logout_redirect_uri: Setting.SelfHost + Setting.Ports.BigScreen + "/user/loginout"
    }
    const mgr = new Oidc.UserManager(config);
    // mgr.signinRedirectCallback().then(res => {
    //       storage.commit('changeACCESS_TOKEN',res.access_token)
    //       storage.commit('changeREFRESH_TOKEN',res.refresh_token)
    //       storage.commit('changeExpires_time',res.expires_at)
    //       router.push({
    //         path:'/'
    //       })
    //     }).catch(err => {
    //        console.log(err)
    //     })
    

    return { 
    }
  }
})
</script>
<style lang="scss" scoped>
@import '@/assets/scss/index.scss';
</style>